import {
  G3xObjBase
} from "@g3xObjBase"
import {
  autorun,
  reaction,
  intercept,
  extendObservable,
  computed
} from 'mobx';
import * as g3xUtils from "@g3x/utils";

  /* 247 */
class MovableObjectLike extends G3xObjBase {
  constructor(realObject, realProperty) {
    const _this = this;
    extendObservable(_this, {
      position: [0, 0, 0]
    });
    _this._realObject = realObject;
    _this._realProperty = realProperty;
    _this._unbind = g3xUtils.bind(_this, 'position', realObject, realProperty);
  }

  destroy() {
    this._unbind = this._unbind && this._unbind();
    //TODO: 访问父类destroy方法
    // return _get3.default(MovableObjectLike.prototype.__proto__ || getPrototypeOf2.default(MovableObjectLike.prototype), 'destroy', this).call(this);
  }

  get realObject(){
    return this._realObject;
  }

  get realProperty(){
    return this._realProperty;
  }
}

export default MovableObjectLike;
